<?php
if (!defined('BASEPATH'))
    exit('No direct script access allowed');
$this->load->view('header');
?>
<section id="container">
    <article class="article_view">
	<header><h1><?php echo $post->post_title; ?></h1>
	    <div class="article_date">
		<time datetime="<?php echo date($post->post_date); ?>" pubdate="pubdate">
		发布时间 : <?php echo date($post->post_date); ?>
		</time>
	    </div>
	</header>
	<div class="article_content">
	    <?php echo $post->post_content_html; ?>
	</div>
	<footer> 
		<?php if ($this->session->userdata('is_logged_in')) : ?>
		<a href="/posts/update/<?php echo $post->ID; ?>">编辑</a>
		<?php endif; ?>
		评论：<?php echo $post->comment_count; ?> 
	</footer>
    </article>
    
    
    <ul>
        <?php if ($post_pre): ?>
	<li>
	    <p><strong>上一篇 : </strong> </p>
	    <p><?php echo anchor("/articles/$post_pre->ID", "$post_pre->post_title", array('title' => "$post_pre->post_title")); ?></p>
	</li>
        <?php endif; ?>
        <?php if ($post_next): ?>
	<li>
	    <p><strong>下一篇 : </strong> </p>
	    <p><?php echo anchor("/articles/$post_next->ID", "$post_next->post_title", array('title' => "$post_next->post_title")); ?></p>
	</li>
        <?php endif; ?>
    </ul>
    
	<?php $this->load->view('comments'); ?>
</section>
<?php $this->load->view('footer'); ?>
